#include "echo.h"
#include "lcd1602.h"

void main() 
{
	float dist = 12.34;
	unsigned char c[8];
	
	Echo_Init();
	LCD_Init();
	
	while(1) 
	{
		dist = Echo_Measure_CM();
		c[0] = (int)dist/10 + 0x30;
		c[1] = (int)dist%10 + 0x30;
		c[2] = '.';
		c[3] = (int)(dist*10)%10 + 0x30;
		c[4] = (int)(dist*100)%10 + 0x30;
		c[5] = 'c';
		c[6] = 'm';
		LCD_Display(c, 1, 0, 7);
	}
}